import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getCategoryAPI } from "@/apis/layout.js"

//分类数据缓存 与他有关的怎么获取也封装，只暴露分类数据
export const useCategoryStore = defineStore('category', () => {
    const categoryData=ref([])
    const getCategory = async () => {
        await getCategoryAPI().then(res=>{
            categoryData.value=res.result
        })
    }

  return { getCategory, categoryData }
})
